package api_day07;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/*
 * Map测试类
 */
public class MapDemo {
    public static void main(String[] args) {
        HashMap<Integer, String> map1 = new HashMap<>();
        map1.put(1,"Lucy");
        map1.put(2,"Lili");
        String v1 = map1.put(3, "Interno");
        map1.put(4,"Liberot");
        map1.put(5,"Urbbr");
        map1.put(6,"Sion");
        String v2 = map1.put(3, "Ayaka");
        String v3 = map1.remove(2);
        String v4 = map1.get(4);
        System.out.println(v1);
        System.out.println(v2);
        System.out.println(v3);
        System.out.println(v4);
        System.out.println(map1);
        System.out.println("-----------------------");
        Set<Map.Entry<Integer, String>> entries = map1.entrySet();
        System.out.println(entries);
        Set<Integer> integers = map1.keySet();
        System.out.println(integers);
        Collection<String> values = map1.values();
        System.out.println(values);
    }
}
